package com.yyfax.pay.common.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 富友查询业务类型
 * 
 * @author buyi
 * @date 2017-08-30 10:31:42
 * @since v2.0.0
 */
public enum FuiouQueryTypeEnum {
	/** 快捷充值 */
	QUICK_CHARGE("CHARGE", "CH", "01"),
	/** 网银充值 */
	EBANK_CHARGE("CHARGE", "CH", "02"),
	/** 委托充值 */
	ENTRUST_CHARGE("CHARGE", "CH", "03"),
	/** 提现 */
	WITHDRAW("", "", "04"),
	/** 委托提现 */
	ENTRUST_WITHDRAW("ENTRUST_WITHDRAW", "EW", "05"),
	/** 冻结 */
	FROZEN("FROZEN", "FN", "06"),
	/** 开户 */
	REGISTER("REGISTER", "RE", "07"),
	/** 转账预冻结 */
	TRANSFER_FROZEN("TRANSFER_FROZEN", "TF", "08"),
	/** 转账预冻结 */
	APPROPRIATE_FROZEN("APPROPRIATE_FROZEN", "AF", "09"),
	/** 冻结到冻结 */
	FROZEN_TO_FRONZEN("FROZEN_TO_FRONZEN", "FF", "10"),
	/** 解冻 */
	UNFROZEN("UNFROZEN", "UF", "11"),
	/** 法人开户 */
	ARTIFICIAL_REGISTER("ARTIFICIAL_REGISTER", "AR", "12"),

	/** 转账(商户与个人之间) */
	TRANSFER_MERCHANT_USER("TRANSFER_MERCHANT_USER", "MU", "13"),
	/** 划拨(个人与个人之间) */
	TRANSFER_USER_USER("TRANSFER_USER_USER", "UU", "14"),
	/** 余额查询 */
	BALANCE_QUERY("BALANCE_QUERY", "BQ", "15"),
	/** 更换手机 */
	CHANGE_PHONE("CHANGE_PHONE", "CP", "16"),
	/** 用户更换银行卡 */
	USER_CHANGE_CARD("USER_CHANGE_CARD", "CC", "17"),
	/** 交易查询 */
	TRADE_QUERY("TRADE_QUERY", "TQ", "18"),
	/** 批量上传 */
	BATCH_UPLOAD("BATCH_UPLOAD", "BU", "50"),
	/** 批量上传结果推送 */
	BATCH_PUSH("BATCH_UPLOAD", "BU", "51"),
	/** 批量下载 */
	BATCH_DOWNLOAD("BATCH_DOWNLOAD", "BD", "51");

	/** 交易业务主键key */
	private String key;
	/** 交易业务主键前缀 */
	private String prefix;
	private String value;

	private FuiouQueryTypeEnum(String key, String prefix, String value) {
		this.key = key;
		this.value = value;
		this.prefix = prefix;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getKey() {
		return key;
	}

	public String getPrefix() {
		return prefix;
	}

	/**
	 * 根据值转换成响应枚举
	 * 
	 * @author buyi
	 * @date 2017-09-04 15:00:17
	 * @since v2.0.0
	 * @param value
	 * @return
	 */
	public static FuiouQueryTypeEnum parse(String value) {
		for (FuiouQueryTypeEnum fuiouBusiTypeEnum : FuiouQueryTypeEnum.values()) {
			if (StringUtils.equals(fuiouBusiTypeEnum.getValue(), value)) {
				return fuiouBusiTypeEnum;
			}
		}

		return null;
	}

}
